import { request, authRequest } from '@/utils/request'
export function getTopics(data) {
  return request('topics', {
    data
  })
}

export function getCategories() {
  return request('categories')
}

export function getTopic(id, data) {
  return request('topics/' + id, {
    data
  })
}

export function getUserTopics(userId, data) {
  return request('users/' + userId + '/topics', {
    data
  })
}

export function deleteTopic(id, data) {
  return authRequest('topics/' + id, {
    method: 'DELETE',
    data
  })
}
